<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html"/>
<head/>

<body>
  <div id="ViewNoteBox">
  <h2 id="title" py:content="note.title">Note Title</h2>
  <label style="color: grey">${note.modified} (created ${note.created})</label>
  <a id="edit_note_link" href="#" onclick="toggle('edit_note');toggle('description'); return false;">
    <img src="/static/images/edit.png" title="edit"/>
  </a>
  <a id="delete_note_link" href="#" onclick="toggle('confirm_delete_note');toggle('delete_note_link')">     <img src="/static/images/delete.gif" title="delete"/>
  </a>

  <div id="confirm_delete_note" class="confirm" style="display: none">
    Are you sure you want to delete the note?
    <a href="/note/delete/${note.id}">Yes</a>
    <a href="#" onclick="toggle('confirm_delete_note');">No</a>
  </div>

  <span id="notes_content">${note._get_textilizedNotes()}</span>

</div>

<div id="edit_note" style="display: none;">
  <form action="#">
    <input type="hidden" id="id" name="id" value="${note.id}"/>
    <fieldset>
      <legend>Edit</legend>
        <p>
          <label for="title_input">Title</label>
          <input type="text" id="title_input" value="${note.title}"/>
        </p>
        <p>
          <label for="notes_input">Notes</label>
          <textarea id="notes_input">${note.notes}</textarea>
        </p>

        <input type="submit" onclick="update_note();toggle('edit_note');toggle('description');" value="save"/>
        <input type="submit" onclick="toggle('edit_note');toggle('description'); return false;" value="cancel"/>
    </fieldset>
  </form>
</div>


</body>
</html>
